<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改素材专辑')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-album-edit" th:object="${album}">
            <input name="albumId" th:field="*{albumId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">相册名称：</label>
                <div class="col-sm-8">
                    <input name="albumName" th:field="*{albumName}" class="form-control" required type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">编码：</label>
                <div class="col-sm-8">
                    <input name="code"  th:field="*{code}" class="form-control" required type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">相册类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('album_type')}">
                        <input type="radio" th:id="${'albumType_' + dict.dictCode}" name="albumType" th:value="${dict.dictValue}" th:field="*{albumType}">
                        <label th:for="${'albumType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">宽度：</label>
                <div class="col-sm-8">
                    <input name="width"  th:field="*{width}" class="form-control"  type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">高度：</label>
                <div class="col-sm-8">
                    <input name="height"  th:field="*{height}" class="form-control"  type="text">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <textarea name="description" class="form-control">[[*{description}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">审核状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('audit_state')}">
                        <input type="radio" th:id="${'auditState_' + dict.dictCode}" name="auditState" th:value="${dict.dictValue}" th:field="*{auditState}">
                        <label th:for="${'auditState_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "cms/album";
        $("#form-album-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-album-edit').serialize());
            }
        }
    </script>
</body>
</html>